package com.jus.player.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tableName = "watch_history")
public class WatchHistory {

    @PrimaryKey(autoGenerate = true)
    private int id;

    @ColumnInfo(name = "user_id")
    private long userId;

    @ColumnInfo(name = "video_id")
    private long videoId;

    @ColumnInfo(name = "episode")
    private int episode;

    @ColumnInfo(name = "total")
    private int total;

    @ColumnInfo(name = "video_title")
    private String videoTitle;

    @ColumnInfo(name = "video_cover")
    private String videoCover;

    @ColumnInfo(name = "video_url")
    private String videoUrl;

    @ColumnInfo(name = "progress")
    private long progress;

    @ColumnInfo(name = "duration")
    private long duration;

    @ColumnInfo(name = "last_watch_time")
    private long lastWatchTime;

    // 构造方法、getter和setter
    public WatchHistory(long userId, long videoId, String videoTitle, String videoCover,
                        String videoUrl, long progress, long duration, long lastWatchTime,
                        int episode, int total) {
        this.videoId = videoId;
        this.videoTitle = videoTitle;
        this.videoCover = videoCover;
        this.videoUrl = videoUrl;
        this.progress = progress;
        this.duration = duration;
        this.lastWatchTime = lastWatchTime;
        this.episode = episode;
        this.total = total;
        this.userId = userId;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public long getUserId() {
        return userId;
    }

    public int getTotal() {
        return total;
    }
    public int getEpisode() {
        return episode;
    }

    public void setEpisode(int episode) {
        this.episode = episode;
    }

    public long getVideoId() {
        return videoId;
    }


    public String getVideoTitle() {
        return videoTitle;
    }


    public String getVideoCover() {
        return videoCover;
    }

    public String getVideoUrl() {
        return videoUrl;
    }

    public long getProgress() {
        return progress;
    }

    public void setProgress(long progress) {
        this.progress = progress;
    }

    public long getDuration() {
        return duration;
    }

    public void setDuration(long duration) {
        this.duration = duration;
    }

    public long getLastWatchTime() {
        return lastWatchTime;
    }
}
